from django.db import models

"""
目前用不到数据库，目前方案是前端把动作组下载成文件，打开加载，不需要把动作放到后端
"""


class ActionGroup(models.Model):
    name = models.CharField(verbose_name='动作组名', max_length=255, null=False, unique=True)

    class Meta:
        db_table = 'action_group'
        verbose_name = '动作组'


class Action(models.Model):
    group = models.ForeignKey(ActionGroup, null=True, on_delete=models.CASCADE, verbose_name='所属动作组', default=None)
    action = models.JSONField(verbose_name='动作', null=True, default=None)
    sort_num = models.IntegerField(verbose_name='排序编号', default=0)

    class Meta:
        db_table = 'action'
        verbose_name = '动作'
